#!/bin/bash

# WiFi认证系统 - 重新编译打包脚本
# 解决 RedisTemplate 编译错误

echo "=========================================="
echo "开始重新编译项目..."
echo "=========================================="

# 1. 清理所有模块
echo "1. 清理旧的编译文件..."
mvn clean -f ruoyi-common/pom.xml
mvn clean -f ruoyi-modules/ruoyi-third-party/pom.xml

# 2. 编译 common 模块
echo "2. 编译 common 模块..."
mvn install -f ruoyi-common/pom.xml -DskipTests

# 3. 编译 third-party 模块
echo "3. 编译 third-party 模块..."
mvn clean package -f ruoyi-modules/ruoyi-third-party/pom.xml -DskipTests

echo "=========================================="
echo "编译完成！"
echo "=========================================="
echo ""
echo "请将以下文件上传到服务器："
echo "ruoyi-modules/ruoyi-third-party/target/ruoyi-modules-third-party.jar"
echo ""
echo "然后重启服务："
echo "  cd /path/to/your/server"
echo "  ./restart.sh"

